Release 10.1A: OpenEdge Development:
Web Services
Temperature sample walk-through
TemperatureSample.pfollows these steps to prepare, call, and process the output from a quote request (source code edited and formatted for clarity):
- Prompts for the requested zip code using the Enter Zip Code field:
- Creates a Web service object in the 4GL:
- Connects to the Web service:
- Sets the handle to the port type in the WSDL where the Web service operation is defined and waits for the user to invoke the request:
- When the user clicks the getTemp button,
TemperatureSample.p:
- Retrieves the zip code entered in the Enter Zip Code field:
- Invokes the Web service
getTempoperation by making a procedure call:
- If there are no errors, assigns the output value from the
getTempprocedure call to the The Temp is field:
- If there are errors, displays the error information:
Note that after displaying all the available error messages, it verifies that a SOAP fault caused the error by checking if a SOAP fault object is part of the error status (
ERROR-STATUS:ERROR-OBJECT-DETAILreferences it). After displaying the basic SOAP fault information, it further verifies that there is SOAP fault detail information by checking if a SOAP fault-detail object is part of the SOAP fault object data (ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-DETAILreferences it) and displays any SOAP fault detail information that it references.- Cleans up by running this code:
which:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |